GroupQty()

Entity-Specific System Function

Syntax samples

GROUPQTY({<entity name>})

ORDER GROUPQTY(Part1) Part2 TO Loc1

IF GROUPQTY(Part1) > 5 THEN...

Description

Returns the number of entities of a specified type in a grouped or loaded entity. If no name is specified, it returns the entire group quantity. If it is a loaded entity, it will only return the number of temporarily loaded entities, not the base entity. For example, if four Castings are temporarily loaded onto a Pallet and called Batch, the GroupQty() will return the number of Castings (i.e., 4), which does not include the base entity Pallet.

In the case of hybrid nested groups with several mixed and nested levels of groups and loads, GroupQty() returns the number of entities in the uppermost level only.

Valid In

Speed fields, traveling-time fields, conveyor-speed fields, Resource fields, operation logic, routing fields, arrival logic, and debug user-condition fields. This function returns an integer.

Components

<entity name>

The optional specific type of entity to search for in the group.

Example

A group of entities called GRPA arrives at Loc1 and process for some amount of time according to a Normal distribution. If the group contains three or more entities it routes to Loc2, otherwise it routes to Loc3. Routing requires 1.2 minutes.

Process Table

Entity

Location

Operation (min)

GRPA

Loc1

WAIT N(3,.1)

IF GROUPQTY() > 2 THEN

ROUTE 1

ELSE

ROUTE 2

Routing Table

Blk

Output

Destination

Rule

Move Logic

1

GRPA

Loc2

FIRST 1

MOVE FOR 1.2

2

GRPA

Loc3

FIRST 1

MOVE FOR 1.2

See Also

GROUP, UNGROUP, and ENT().